$(function() {

    $('.accordion-group').on('show', function (e) {
         $(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active-accordion');
    });

    $('.accordion-group').on('hide', function (e) {
        $(this).find('.accordion-toggle').not($(e.target)).removeClass('active-accordion');
    });

    $('.accordion-group').each(function(){
	    if ($(this).find('.accordion-heading').hasClass('active-accordion-page')) {
	    	$(this).find('.accordion-body').collapse('show');
	    }
	});
});